/* 分析结果组件样式 */

/* 结果容器 */
.analysis-results {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.analysis-results .ant-card-body {
  padding: 0;
  height: calc(100% - 57px);
  overflow: hidden;
}

/* 加载状态 */
.analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #666;
}

.analysis-loading .anticon {
  font-size: 32px;
  margin-bottom: 16px;
  color: #1890ff;
}

/* 空状态 */
.analysis-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #999;
  padding: 24px;
}

.analysis-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  color: #d9d9d9;
}

.analysis-empty-text {
  font-size: 16px;
  margin-bottom: 8px;
  color: #666;
}

/* 分析统计 */
.analysis-stats {
  padding: 16px;
  border-bottom: 1px solid #e8e8e8;
  background-color: #fafafa;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 16px;
}

.stat-item {
  text-align: center;
}

.stat-item .ant-statistic-content {
  font-size: 18px;
}

.stat-item .ant-statistic-title {
  font-size: 12px;
  color: #666;
}

/* Tab标签样式 */
.tab-badge {
  background-color: #ff4d4f;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  margin-left: 4px;
}

/* 问题列表容器 */
.problems-container {
  height: calc(100vh - 400px);
  min-height: 400px;
}

.statistics-container {
  padding: 16px;
  height: calc(100vh - 400px);
  min-height: 400px;
  overflow-y: auto;
}

/* 虚拟化问题列表 */
.virtualized-problem-list {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 筛选工具栏增强 */
.filter-toolbar {
  padding: 16px;
  border-bottom: 1px solid #e8e8e8;
  background-color: #fafafa;
  border-radius: 6px 6px 0 0;
}

/* 批量操作工具栏 */
.batch-toolbar {
  padding: 12px 16px;
  background-color: #e6f7ff;
  border-bottom: 1px solid #91d5ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0;
}

/* 问题列表头部 */
.problem-list-header {
  padding: 12px 16px;
  background-color: #fafafa;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.problem-count {
  font-weight: 500;
  color: #262626;
}

/* 虚拟列表容器 */
.virtual-list-container {
  flex: 1;
  overflow: hidden;
  background-color: #fff;
}

/* 确保虚拟列表项正确对齐 */
.virtual-list-container > div {
  outline: none; /* 移除focus outline */
}

.virtual-list-container > div > div {
  padding: 0 !important; /* 移除react-window的默认padding */
}

/* 严重程度标签优化 */
.ant-tag {
  border-radius: 10px;
  font-weight: 500;
  font-size: 11px;
  padding: 2px 8px;
  border: none;
}

/* 收起展开按钮样式 */
.problem-group-header .ant-btn {
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s;
}

.problem-group-header .ant-btn:hover {
  border-color: #1890ff;
  color: #1890ff;
}

/* 徽章样式优化 */
.ant-badge-count {
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
}

/* 问题分组头部 */
.problem-group-header {
  padding: 14px 16px;
  background-color: #fafafa;
  border-bottom: 1px solid #e8e8e8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  border-radius: 6px 6px 0 0;
  margin-bottom: 2px;
  height: 60px; /* 固定高度与getItemSize一致 */
  box-sizing: border-box;
}

.problem-group-header:hover {
  background-color: #e6f7ff;
  border-color: #91d5ff;
}

.problem-group-header.expanded {
  background-color: #e6f7ff;
  border-left: 4px solid #1890ff;
  border-color: #91d5ff;
}

.group-title {
  font-weight: 600;
  font-size: 14px;
  color: #262626;
}

/* 问题项 */
.problem-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s;
  cursor: pointer;
  background: #fff;
  margin-bottom: 1px;
  box-sizing: border-box;
  min-height: 80px; /* 简化后的最小高度 */
  display: flex;
  flex-direction: column;
}

.problem-item:hover {
  background-color: #fafafa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.problem-item.active {
  background-color: #e6f7ff;
  border-left: 4px solid #1890ff;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.problem-item-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.problem-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.problem-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.problem-location {
  font-weight: 600;
  color: #262626;
  font-size: 13px;
}

.problem-category {
  font-size: 11px;
  border-radius: 12px;
}

.problem-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.problem-item:hover .problem-actions {
  opacity: 1;
}

.action-btn {
  border-radius: 4px;
}

.action-btn:hover {
  background-color: #f0f9ff;
  color: #1890ff;
}

.problem-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.problem-description {
  color: #262626;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
  word-break: break-word;
}

.problem-code-section {
  margin: 8px 0;
  flex-shrink: 0;
}

.code-label {
  font-size: 12px;
  color: #8c8c8c;
  margin-bottom: 4px;
  font-weight: 500;
}

.problem-code {
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 8px;
  margin: 4px 0;
  border-left: 3px solid #1890ff;
  overflow-x: auto;
  max-height: 160px;
  overflow-y: auto;
}

.problem-code code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  color: #24292e;
  background: none;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.problem-suggestion {
  margin-top: 8px;
  padding: 6px 10px;
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-shrink: 0;
}

.suggestion-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.suggestion-text {
  font-size: 12px;
  color: #52c41a;
  line-height: 1.3;
  word-break: break-word;
}

/* 空结果 */
.empty-result {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

/* AI分析结果特有样式 */
.ai-analysis-results {
  /* AI分析特有样式 */
}

.confidence-meter {
  margin: 16px 0;
}

.confidence-meter .ant-progress-text {
  font-size: 12px;
}

.optimization-preview {
  margin: 16px 0;
  padding: 12px;
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 6px;
}

.code-diff {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

.code-diff .original,
.code-diff .optimized {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
}

.code-diff .original {
  background-color: #fff2f0;
  border: 1px solid #ffccc7;
}

.code-diff .optimized {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
}

/* 2K显示器优化 - 移除响应式设计 */
.problems-container,
.statistics-container {
  height: calc(100vh - 320px);
  min-height: 600px;
  margin: 0 16px; /* 增加左右边距 */
}

.analysis-stats {
  padding: 16px 32px; /* 增加左右内边距 */
  margin: 0 16px; /* 增加左右边距 */
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-down {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动条样式 */
.virtual-list-container ::-webkit-scrollbar {
  width: 6px;
}

.virtual-list-container ::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.virtual-list-container ::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.virtual-list-container ::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}